package org.zuel.boot.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RouterController {
    @RequestMapping({"/", "/index"})
    public String index() {
        return "index"; // 返回视图名称，对应 templates/index.html
    }

    @RequestMapping("/home")
    public String home() {
        return "home"; // 返回视图名称，对应 templates/home.html
    }

    @RequestMapping("/level1/{id}")
    public String level1(@PathVariable String id) {
        return "level1/" + id; // 返回视图路径，对应 templates/level1/{id}.html
    }
}